<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs for page SendNotification.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="file-name">/SendNotification.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Manages the transmission of push notifications from the server to the push notification servers (both iOS and android), as well as managing the list of registered devices</p>
	<ul class="tags">
				<li><span class="field">author:</span> Andrew Pigram</li>
				<li><span class="field">version:</span> 1.0</li>
			</ul>
		
			</div>
</div>
		

	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functionconnectToAFS" id="functionconnectToAFS"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">connectToAFS</span> (line <span class="line-number">45</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect the socket to the Apple Feedback Server</p>
	<ul class="tags">
				<li><span class="field">global:</span> socket $socket: The socket pointer</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			connectToAFS
		</span>
				()
			</div>

		
	
</div>
<a name="functionconnectToAPNS" id="functionconnectToAPNS"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">connectToAPNS</span> (line <span class="line-number">31</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect the socket to the Apple Push Notification Server</p>
	<ul class="tags">
				<li><span class="field">global:</span> socket $socket: The socket pointer</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			connectToAPNS
		</span>
				()
			</div>

		
	
</div>
<a name="functionmakePayload" id="functionmakePayload"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">makePayload</span> (line <span class="line-number">59</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create a payload for transmission to the push notification server using the required protocol</p>
	<ul class="tags">
				<li><span class="field">return:</span> The notification payload</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			makePayload
		</span>
				()
			</div>

		
	
</div>
<a name="functionremoveDevices" id="functionremoveDevices"><!-- --></a>
<div class="oddrow">
	
	<div>
		<span class="method-title">removeDevices</span> (line <span class="line-number">76</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Remove deregistered devices from the device database</p>
	<ul class="tags">
				<li><span class="field">global:</span> db $devices: The database handle</li>
				<li><span class="field">todo:</span> Implement the removal of a device token from the database</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			removeDevices
		</span>
				()
			</div>

		
	
</div>
<a name="functionsendToDevice" id="functionsendToDevice"><!-- --></a>
<div class="evenrow">
	
	<div>
		<span class="method-title">sendToDevice</span> (line <span class="line-number">98</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Send the notification to the APNS to push to the device referred to by the token</p>
	<ul class="tags">
				<li><span class="field">global:</span> socket $socket: The socket pointing to the APNS</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			sendToDevice
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$devToken</span>, <span class="var-type">array</span>&nbsp;<span class="var-name">$payload</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$devToken</span><span class="var-description">: The device token of the device the notification is to be sent to</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$payload</span><span class="var-description">: The notification to send to the push notification server</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Tue, 12 Jun 2012 00:48:34 +1000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>